package com.sc.nft.task;

import com.sc.nft.entity.CopyrightAuctionRecord;
import com.sc.nft.service.CopyrightAuctionRecordService;
import com.sc.nft.service.CopyrightAuctionRoundService;
import com.sc.nft.service.CopyrightAuctionService;
import com.sc.nft.service.InformationArticleService;
import com.sc.nft.service.impl.DigitalCollectionProductInfoAuctionUserBiddingResultsServiceImpl;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
@Slf4j
public class AuctionTask {

    private final DigitalCollectionProductInfoAuctionUserBiddingResultsServiceImpl userBiddingResultsService;
    private final CopyrightAuctionRoundService copyrightAuctionRoundService;
    private final CopyrightAuctionService copyrightAuctionService;

    /**
     * 拍卖开奖
     */
    @XxlJob("auctionLottery")
    public void auction()  {
        userBiddingResultsService.auctionDisposal();
    }

    /**
     * 二级拍卖开奖
     */
    @XxlJob("copyrightAuctionRoundAuctionLottery")
    public void copyrightAuctionRoundAuctionLottery()  {
        copyrightAuctionRoundService.auctionDisposal();
    }

    /**
     * 拍卖平台用户分成
     */
    @XxlJob("copyrightAuctionPlatformDividends")
    public void platformDividends()  {
        copyrightAuctionService.platformDividends();
    }
}
